/**
 * 
 */
package game;

/**
 * @author Jean-Baptiste BORIC
 *
 */
public class Player {
	private int id;
	private String name;
	private boolean hasLost;
	
	/**
	 * @param id
	 * @param name
	 */
	public Player(int id, String name) {
		super();
		this.setID(id);
		this.setName(name);
	}

	/**
	 * @return Player ID
	 */
	public int getID() {
		return id;
	}
	
	/**
	 * @param id PlayerID
	 */
	public void setID(int id) {
		if(id < 0) {
			throw new IllegalArgumentException("ID below 0");
		}
		this.id = id;
	}
	
	/**
	 * @return Name of the player
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * @param name Name of the player
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * @return Player lost flag
	 */
	public boolean isHasLost() {
		return hasLost;
	}
	
	/**
	 * @param hasLost Player lost flag
	 */
	public void setHasLost(boolean hasLost) {
		this.hasLost = hasLost;
	}

	@Override
	public String toString() {
		return id + "\t" + name + "\t" + hasLost;
	}
}
